#include<bits/stdc++.h>
using namespace std;
int main(){
	freopen("apple.in" , "r" , stdin);
	freopen("apple.out" , "w" , stdout);
	int n , day = 0 , b = 0;
	cin >> n;
	int i = n , a = 0;
	while(i > 0){
		day = day + 1;
		if(i % 3 == 1 && b == 0){
			b = day;
		}
		a = ceil((double)i / 3);
		i = i - a;
	}
	cout << day << " " << b << endl;
	return 0;
}
